package com.kelab.dify.model.chat;

import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Map;

/**
 * 聊天请求模型
 * 
 * @author kelab
 * @version 1.0
 */
public class ChatRequest {
    
    @JsonProperty("inputs")
    private Map<String, Object> inputs;
    
    @JsonProperty("query")
    private String query;
    
    @JsonProperty("response_mode")
    private String responseMode;
    
    @JsonProperty("conversation_id")
    private String conversationId;
    
    @JsonProperty("user")
    private String user;
    
    @JsonProperty("files")
    private List<FileInfo> files;
    
    @JsonProperty("auto_generate_name")
    private Boolean autoGenerateName;
    
    /**
     * 默认构造函数
     */
    public ChatRequest() {
    }
    
    /**
     * 构造函数
     * 
     * @param query 用户查询
     * @param user 用户标识
     */
    public ChatRequest(String query, String user) {
        this.query = query;
        this.user = user;
        this.responseMode = "blocking"; // 默认为阻塞模式
    }
    
    // Getter和Setter方法
    
    public Map<String, Object> getInputs() {
        return inputs;
    }
    
    public void setInputs(Map<String, Object> inputs) {
        this.inputs = inputs;
    }
    
    public String getQuery() {
        return query;
    }
    
    public void setQuery(String query) {
        this.query = query;
    }
    
    public String getResponseMode() {
        return responseMode;
    }
    
    public void setResponseMode(String responseMode) {
        this.responseMode = responseMode;
    }
    
    public String getConversationId() {
        return conversationId;
    }
    
    public void setConversationId(String conversationId) {
        this.conversationId = conversationId;
    }
    
    public String getUser() {
        return user;
    }
    
    public void setUser(String user) {
        this.user = user;
    }
    
    public List<FileInfo> getFiles() {
        return files;
    }
    
    public void setFiles(List<FileInfo> files) {
        this.files = files;
    }
    
    public Boolean getAutoGenerateName() {
        return autoGenerateName;
    }
    
    public void setAutoGenerateName(Boolean autoGenerateName) {
        this.autoGenerateName = autoGenerateName;
    }
    
    /**
     * 文件信息内部类
     */
    public static class FileInfo {
        @JsonProperty("type")
        private String type;
        
        @JsonProperty("transfer_method")
        private String transferMethod;
        
        @JsonProperty("url")
        private String url;
        
        @JsonProperty("upload_file_id")
        private String uploadFileId;
        
        public FileInfo() {
        }
        
        public FileInfo(String type, String transferMethod, String url) {
            this.type = type;
            this.transferMethod = transferMethod;
            this.url = url;
        }
        
        // Getter和Setter方法
        public String getType() {
            return type;
        }
        
        public void setType(String type) {
            this.type = type;
        }
        
        public String getTransferMethod() {
            return transferMethod;
        }
        
        public void setTransferMethod(String transferMethod) {
            this.transferMethod = transferMethod;
        }
        
        public String getUrl() {
            return url;
        }
        
        public void setUrl(String url) {
            this.url = url;
        }
        
        public String getUploadFileId() {
            return uploadFileId;
        }
        
        public void setUploadFileId(String uploadFileId) {
            this.uploadFileId = uploadFileId;
        }
    }
}